package com.hongfan.config.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zcs
 * @since 2023/10/20
 */
@Slf4j
@RestController
@RequestMapping("/config")
@RefreshScope
public class ConfigInfoController {

    @Value("${name}")
    private String name;

    @RequestMapping("/getConfigInfo")
    public String getConfigInfo() {
        log.info("从配置中心获取的数据：" + name);
        return name;
    }



}
